package com.wkh.datastructure;
//反向打印字符串
public class ReverseString {
    //递归函数
    public static void reverse(int n,String str){
        if (n == str.length()){
            return;
        }
        reverse(n+1,str);
        System.out.println(str.charAt(n));
    }

    public static void main(String[] args) {
        reverse(0,"abcd");
    }
}
